<#include "/template/_openwin.html" /> <#assign title="个人系统配置">
<@buttons>
<a href="#" class="easyui-linkbutton"
	data-options="plain:true,iconCls:'icon-save'" onclick="save()">保存设置</a>
<a href="#" class="easyui-linkbutton"
	data-options="plain:true,iconCls:'icon-edit'">修改密码</a>
</@buttons> <@body>


<div style="width: 100%; height: auto;">
	<form id="ff" method="post" action="${root!}/frameuserconfig/save">
		<input type="hidden" name="userExt.id" value="${userExt.id!}" />
		<table class="form-table" style="width: 800px;">

			<tr style="display: none;">
				<td width="16%"></td>
				<td width="16%"></td>
				<td width="16%"></td>
				<td width="16%"></td>
				<td width="16%"></td>
				<td width="16%"></td>
			</tr>

			<tr>
				<td>界面主题:</td>
				<td colspan="2">
					<input id="cb-theme" name="userExt.theme" class="easyui-combobox" data-options="valueField:'value',textField:'label'" />
				</td>
				<td>表格行数:</td>
				<td colspan="2">
					<input id="cb-tableSize" name="userExt.tableSize" class="easyui-combobox" data-options="valueField:'value',textField:'label'" />
				</td>
			</tr>
			<tr>
				<td>头像:</td>
				<td colspan="5">
					<img id="me-img" alt="me" src="${userExt.userImgUrl!}" width="80px" height="100px" border="0" >
					<@upload url="${root!}/upload/userImgUp" btnText="选择图片" multi="false" id="myupload" auto="false" onComplete="imgChange" targetId="${userExt.id!}" />
				</td>
			</tr>
		</table>
	</form>
</div>

<script type="text/javascript">

$(function(){
	$('#cb-theme').combobox({
		data:[{label:'default',value:'default'},{label:'bootstrap',value:'bootstrap'},
		      {label:'black',value:'black'},{label:'gray',value:'gray'},
		      {label:'metro-blue',value:'metro-blue'},{label:'metro-default',value:'metro-default'},
		      {label:'metro-gray',value:'metro-gray'},{label:'metro-green',value:'metro-green'},
		      {label:'metro-orange',value:'metro-orange'},{label:'metro-red',value:'metro-red'}],
		onLoadSuccess:function(){
			$('#cb-theme').combobox('select','${userTheme}');
		}
	});

	$('#cb-tableSize').combobox({
		data:[{label:'10',value:'10'},{label:'20',value:'20'},
		      {label:'30',value:'30'},{label:'40',value:'40'},
		      {label:'50',value:'50'}],
		onLoadSuccess:function(){
			$('#cb-tableSize').combobox('select','${tableSize}');
		}
	});
});

function save(){
	$('#ff').form('submit',{
		dataType:"json",
		success:function(msg){
			Alert.info(msg,"系统消息","close");
		}
	});
}

function imgChange(val){
	$('#me-img').attr("src","${root!}/UploadFiles/UserImg/"+val.name);
}
</script>
</@body>
